package a.f.l.a;

import a.c.z;

import java.util.HashMap;
import java.util.List;

class kc
  extends sb
{
  private int f;
  private int g;
  private int[] h;
  private int[] i;
  private int j;
  private double[] k;
  private boolean l = true;
  private boolean m;
  
  protected void b(rb paramrb)
  {
    super.b(paramrb);
    this.f = paramrb.e().f().i();
    if (!sb.e) {}
    this.m = (this.f > 0);
  }
  
  double[] a(h paramh, mb parammb, jb[] paramArrayOfjb, m[] paramArrayOfm, double[] paramArrayOfDouble)
  {
    boolean bool = sb.e;
    int i2 = sb.d;
    if (!bool)
    {
      if ((!this.m) || (paramh.d() == null)) {
        b("min edge dist penalty", 0.0D, false);
      }
    }
    else {
      return new double[paramArrayOfjb.length];
    }
    z localz1 = null;
    z localz2 = null;
    HashMap localHashMap = new HashMap();
    if (!bool)
    {
      if (this.l) {
        a(paramh, localHashMap);
      }
    }
    else
    {
      localz1 = (z)localHashMap.get(paramh.a());
      localz2 = (z)localHashMap.get(parammb);
    }
    boolean[] arrayOfBoolean = new boolean[paramArrayOfjb.length];
    jb localjb1 = paramh.c();
    mb localmb = paramh.a();
    jb localjb2 = a(localmb, paramArrayOfjb[0].a());
    int n = paramArrayOfm[0].e();
    if (!bool)
    {
      Object localObject;
      switch (n)
      {
      case 0: 
      case 1: 
        r localr = a().a(b().d());
        int i1;
        if (!bool)
        {
          if (!paramh.i()) {
            if (bool) {
              break label319;
            }
          }
        }
        else if (localr.e(true).size() > 0)
        {
          i1 = 0;
          do
          {
            if (i1 >= paramArrayOfjb.length) {
              break;
            }
            if (i2 != 0) {
              break label324;
            }
            if (paramArrayOfm[i1].e() == 0)
            {
              localObject = localr.a(localr.a(paramh.a(), parammb, paramArrayOfjb[i1], true));
              if (!bool) {}
              arrayOfBoolean[i1] = (((List)localObject).size() > 0 ? 1 : false);
            }
            i1++;
          } while (i2 == 0);
        }
        if ((!bool) && (localr.e(false).size() > 0))
        {
          i1 = 0;
          do
          {
            if (i1 >= paramArrayOfjb.length) {
              break;
            }
            localObject = localr.a(localr.a(paramh.a(), parammb, paramArrayOfjb[i1], false));
            if (i2 != 0) {
              break label558;
            }
            if (!bool) {}
            arrayOfBoolean[i1] |= (((List)localObject).size() > 0 ? 1 : 0);
            i1++;
          } while (i2 == 0);
        }
        jb[] arrayOfjb = { localjb2 };
        this.g = a(localmb, arrayOfjb, localz1, new boolean[1])[0];
        if (bool) {
          break label558;
        }
        if (bool) {
          break label553;
        }
      case 2: 
        if ((i2 == 0) || ((!bool) && (i2 == 0))) {
          break;
        }
      case 3: 
        label319:
        label324:
        localObject = new jb[] { localjb2 };
        this.g = a(localmb, localObject, localz1, new boolean[1])[0];
        if (!bool) {
          if (localz1 == null) {
            localz1 = new z();
          }
        }
        localz1.add(localjb1);
      }
      this.h = a(localmb, paramArrayOfjb, localz1, arrayOfBoolean);
      this.i = a(parammb, paramArrayOfjb, localz2, arrayOfBoolean);
      a(paramh, paramArrayOfjb, paramArrayOfm, localHashMap, arrayOfBoolean);
    }
    label553:
    this.j = 0;
    label558:
    return super.a(paramh, parammb, paramArrayOfjb, paramArrayOfm, paramArrayOfDouble);
  }
  
  private void a(h paramh, HashMap paramHashMap)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    h localh = paramh.b();
    m localm = paramh.j();
    label154:
    label183:
    do
    {
      if (localh == null) {
        break;
      }
      mb localmb = localh.a();
      if (!bool) {
        if (localm != null)
        {
          Object localObject = (List)paramHashMap.get(localmb);
          if (!bool) {
            if (localObject == null)
            {
              localObject = new z();
              paramHashMap.put(localmb, localObject);
            }
          }
          ((List)localObject).add(localm.n());
          int n = localm.e();
          if (!bool)
          {
            if (n != 1)
            {
              if (bool) {
                break label154;
              }
              if (n != 2)
              {
                if (bool) {
                  continue;
                }
                if (n != 3) {
                  break label183;
                }
              }
            }
            ((List)localObject).add(localm.m());
            if (bool) {
              continue;
            }
          }
          if (n != 2)
          {
            jb localjb = a(localmb, localm.m().a());
            ((List)localObject).add(localjb);
          }
        }
      }
      localm = localh.j();
      localh = localh.b();
    } while (i1 == 0);
  }
  
  private void a(h paramh, jb[] paramArrayOfjb, m[] paramArrayOfm, HashMap paramHashMap, boolean[] paramArrayOfBoolean)
  {
    boolean bool = sb.e;
    int i6 = sb.d;
    if (!bool)
    {
      if (paramh.d() == paramArrayOfm[0].p()) {
        this.k = new double[paramArrayOfjb.length];
      }
    }
    else
    {
      z localz = new z();
      int[] arrayOfInt1 = new int[paramArrayOfjb.length];
      int n = 0;
      do
      {
        if (n >= paramArrayOfjb.length) {
          break;
        }
        jb localjb = paramArrayOfjb[n];
        if (i6 != 0) {
          break label142;
        }
        if (paramArrayOfm[n].e() == 0)
        {
          if (bool) {
            continue;
          }
          if (paramArrayOfm[n].m().d() > localjb.d())
          {
            arrayOfInt1[localz.size()] = n;
            localz.add(localjb);
          }
        }
        n++;
      } while (i6 == 0);
      if ((bool) || (localz.size() > 0))
      {
        label142:
        jb[] arrayOfjb = (jb[])localz.toArray(new jb[localz.size() + 1]);
        int i1 = arrayOfjb.length - 1;
        arrayOfjb[i1] = paramh.c();
        int[] arrayOfInt2 = new int[arrayOfjb.length];
        m localm = paramh.j();
        h localh = paramh.b();
        do
        {
          if (localh == null) {
            break;
          }
          mb localmb = localh.a();
          List localList = (List)paramHashMap.get(localmb);
          int[] arrayOfInt3 = a(localmb, arrayOfjb, localList, new boolean[arrayOfjb.length]);
          int i4 = arrayOfInt3[i1];
          if (i6 != 0) {
            break label357;
          }
          int i5 = 0;
          if (i5 < arrayOfInt2.length)
          {
            arrayOfInt2[i5] = (arrayOfInt2[i5] - i4 + arrayOfInt3[i5]);
            i5++;
          }
          while (bool)
          {
            if ((!bool) && (i6 != 0)) {
              break label351;
            }
            if (i6 == 0) {
              break;
            }
          }
          if ((!bool) && (localm == null)) {
            break;
          }
          if (!bool)
          {
            if (localm.e() != 0) {
              break;
            }
            localm = localh.j();
            localh = localh.b();
          }
        } while (i6 == 0);
        label351:
        if (!bool)
        {
          label357:
          int i2 = 0;
          do
          {
            if (i2 >= arrayOfInt2.length - 1) {
              break;
            }
            int i3 = arrayOfInt1[i2];
            if (!bool)
            {
              if (paramArrayOfBoolean[i3] == 0) {
                this.k[i3] = arrayOfInt2[i2];
              }
              i2++;
            }
          } while (i6 == 0);
        }
      }
    }
  }
  
  protected double a(h paramh, mb parammb, jb paramjb, m paramm, double paramDouble)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    int n = this.j++;
    double d = this.i[n];
    if (!bool) {
      if (d > paramDouble)
      {
        a("min edge dist penalty", d, false);
        return d;
      }
    }
    if (!bool) {}
    switch (paramm.e())
    {
    case 1: 
    case 3: 
      d += this.h[n];
      d += this.g;
      if (bool) {
        break label177;
      }
      if (i1 == 0) {
        break;
      }
    case 2: 
      d += this.h[n];
      if (bool) {
        break label177;
      }
      if (i1 == 0) {
        break;
      }
    case 0: 
      d += this.k[n];
    }
    a("min edge dist penalty", d, false);
    label177:
    return d;
  }
  
  protected int[] a(mb parammb, jb[] paramArrayOfjb, List paramList, boolean[] paramArrayOfBoolean)
  {
    boolean bool = sb.e;
    int i1 = sb.d;
    fb localfb = parammb.b();
    boolean[] arrayOfBoolean = ((!bool) && (paramList == null)) || (paramList.isEmpty()) ? localfb.a(paramArrayOfjb, paramArrayOfBoolean) : localfb.a(paramArrayOfjb, paramList);
    int[] arrayOfInt = new int[paramArrayOfjb.length];
    int n = 0;
    do
    {
      while (i1 == 0)
      {
        if (n >= paramArrayOfjb.length) {
          break;
        }
        if ((!bool) && (i1 != 0)) {
          break label121;
        }
        if (!bool) {}
        arrayOfInt[n] = (arrayOfBoolean[n] != 0 ? 0 : this.f);
        n++;
      }
    } while (bool);
    label121:
    return arrayOfInt;
  }
  
  private jb a(mb parammb, boolean paramBoolean)
  {
    mb.a_ locala_ = paramBoolean ? mb.a_.a : mb.a_.d;
    return parammb.a(locala_);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.a.kc

 * JD-Core Version:    0.7.0.1

 */